UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yYDcO8v9HU82BkW4QE0l4YfvYGfgFHCQe2oaX1EJn7I='
WHERE
key_id = '9b6225f4c96b1f9e496457047227a12832c2a4bda4422fce957ecad0efb690e0'
AND (
token = 'yYDcO8v9HU82BkW4QE0l4YfvYGfgFHCQe2oaX1EJn7I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)