UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6n4aeQnPR39o8x4ldFMq2ZKnMsYNRzIuCKt8qOwKBzI='
WHERE
key_id = 'fa8d7c1fb588f71d2fedd3c448dead855bcc3dcf1af9548a27c8e625ee4e2b64'
AND (
token = '6n4aeQnPR39o8x4ldFMq2ZKnMsYNRzIuCKt8qOwKBzI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)