UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KrrvaloPDbAyaz8c14E7koXAnkI4AoyhC6YylQzCyfY='
WHERE
key_id = 'f65076ca8e0f561625a082cfc3e9479795c3ff141fb7243814d48c23cbdae046'
AND (
token = 'KrrvaloPDbAyaz8c14E7koXAnkI4AoyhC6YylQzCyfY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)