UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zg6XJor6E7vJNwPX5zwOHZLESOTdCLrnLINRApwUFLI='
WHERE
key_id = '7d2d0811b5b852487be81520b057737ffe95f080701c1ac9d58d7acf6002e96f'
AND (
token = 'zg6XJor6E7vJNwPX5zwOHZLESOTdCLrnLINRApwUFLI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)