UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+r9ycrd+kj1lpHzFwXgme3LpIfJK9wb1wqm0nPl6iw0='
WHERE
key_id = 'be6bb8b2673d7a383cc0823e1bed58c4dc543b251f2fee4845f958fcc2b438ab'
AND (
token = '+r9ycrd+kj1lpHzFwXgme3LpIfJK9wb1wqm0nPl6iw0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)