UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/9vvjHdH3ieA+eKNg7E9BCKXBySVZbklghPRwEkZLKI='
WHERE
key_id = 'd9bb0881b8a018cac5d07cf79c9b1254b90b8c09362f5411c2dfe4ed0750862f'
AND (
token = '/9vvjHdH3ieA+eKNg7E9BCKXBySVZbklghPRwEkZLKI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)