UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CoeE9amNgAO32inT0IwSY6lJ5qLhfCJU4lNHwUZf/Vo='
WHERE
key_id = '142c5b44cb913953830963bba85bc5afeb6fd447feaab5f56d3f7d8359fe63da'
AND (
token = 'CoeE9amNgAO32inT0IwSY6lJ5qLhfCJU4lNHwUZf/Vo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)