UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xRMm9Lyxu11IULmwSnnMyKLtffWJBNWUMyRAsa7xC7c='
WHERE
key_id = '562148e5f190ef6fd808a966b84d618e3ec2f57eeb3206cfa99c31f99933644b'
AND (
token = 'xRMm9Lyxu11IULmwSnnMyKLtffWJBNWUMyRAsa7xC7c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)