UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KxU3mv515GOV/SmoHHsRQXGRP1+MCzqXH83AHdXxqg4='
WHERE
key_id = '7ce56cdc8d4291c3f278eed0d1a556c42b92e8917bf9beabb81b82bd316207f3'
AND (
token = 'KxU3mv515GOV/SmoHHsRQXGRP1+MCzqXH83AHdXxqg4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)