UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Rrnd4OH1zJ9zdrzfWh85zHRcr6PiQPbZrdCFy/q27uY='
WHERE
key_id = 'd7b71d9e3f09fb4b238108574e17b897fab81f69717382f35350c86651b297a0'
AND (
token = 'Rrnd4OH1zJ9zdrzfWh85zHRcr6PiQPbZrdCFy/q27uY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)