UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EZiOlCfze/prEzgGVVahi3bnaLyUuK1NWnPep7NxvP8='
WHERE
key_id = '42929fdfd44afdfb6efb16a17b0e58929654cb820e7ffc10e522aa92ddac5cb9'
AND (
token = 'EZiOlCfze/prEzgGVVahi3bnaLyUuK1NWnPep7NxvP8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)