UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 't8THPEVOcaevT09QjxAG1lkstlD3Pq3bECrF/pKq5io='
WHERE
key_id = 'c79f6edd601d36f5031a5e712ddc6ae970078ffd1a66d5392ff420245f11bea1'
AND (
token = 't8THPEVOcaevT09QjxAG1lkstlD3Pq3bECrF/pKq5io='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)