UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'm9YWabMCptIUioejVHAXZkYS0yjHgejW2VuuV858kBE='
WHERE
key_id = '3006a5d1ca628b5c5676d1800795551db3fb9f781c2a5b4d1e9b05d364e72289'
AND (
token = 'm9YWabMCptIUioejVHAXZkYS0yjHgejW2VuuV858kBE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)