UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HqE2E1ZShiJ1EjB15/YX+Y2MHm8+SQ62BOEjIimgz/Q='
WHERE
key_id = '63d976eb215eb63ca92a4aa1b2d7a98eac96d82eb9eda4fd0c8c51681c779d09'
AND (
token = 'HqE2E1ZShiJ1EjB15/YX+Y2MHm8+SQ62BOEjIimgz/Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)