UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BxZIBoDgMbpw7p/a3daOnkT8sXs2dWKDMFf51swZ8Zo='
WHERE
key_id = '27e3e6230fc01ec6452d92fdad8f4494c5eb63846b63130df0757ef7f66f4a5f'
AND (
token = 'BxZIBoDgMbpw7p/a3daOnkT8sXs2dWKDMFf51swZ8Zo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)