UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'je5lXbROxzb3pB+gwLLi2PS86ehYfiqtUYi+pOvS9yw='
WHERE
key_id = '2737b115514513148fdc5bb82578679c3ca5f8b3b4f605aa59746d32c07fd9b5'
AND (
token = 'je5lXbROxzb3pB+gwLLi2PS86ehYfiqtUYi+pOvS9yw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)