UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'if9NaWqdlJQtyPqm0HS8dfGxsx60uPBsBfWKon6D1AE='
WHERE
key_id = '6b9cea5dc692fcfb8b7ae042e971511d1b491e0140233559797ac2016c49395a'
AND (
token = 'if9NaWqdlJQtyPqm0HS8dfGxsx60uPBsBfWKon6D1AE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)