UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2jfstBpWW6InSyAOGc0zjrfmZoq7U6clrDGfRXs3kZM='
WHERE
key_id = 'cf26764dfbcf7979c7bdff376896b9021098587955aac1c0579803d63bb66ab6'
AND (
token = '2jfstBpWW6InSyAOGc0zjrfmZoq7U6clrDGfRXs3kZM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)