UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RkyOfvXhVIFZBPxNubNERHhKwQXb6xmGECKWyK8qMIE='
WHERE
key_id = '2e9a73b708567f520b08b5a74197abb988250462b6ad5fe329aa56703314c6c3'
AND (
token = 'RkyOfvXhVIFZBPxNubNERHhKwQXb6xmGECKWyK8qMIE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)