UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Sa3cqDpL1TQ69PVfBCAdX4ElHaltX/LXW5jQJ3V959I='
WHERE
key_id = '2b81b84040b7d7e69f965083d1cf543f41ca409f5d91d0e429ac1fa4a721643b'
AND (
token = 'Sa3cqDpL1TQ69PVfBCAdX4ElHaltX/LXW5jQJ3V959I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)