UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xHOMOA2SfBaTmkjbB8DahuXdJ8aNe3nDBKWi91rjvXA='
WHERE
key_id = '8a80e762529062bc4a8069c6ffe31b7a2d7a68732c04dabfca9a7d8658c450a4'
AND (
token = 'xHOMOA2SfBaTmkjbB8DahuXdJ8aNe3nDBKWi91rjvXA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)