UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'v0PWhL6ZULe1tRfOKRxuviqwaknruMBhX1i3uSiHw8E='
WHERE
key_id = '999847daccad1e8201e67fa4f1653f67c0eba59638c790740605ecdf68ac2c2f'
AND (
token = 'v0PWhL6ZULe1tRfOKRxuviqwaknruMBhX1i3uSiHw8E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)