UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+shuuL8yAGwnVssoRRFT6JsNGvC7VXjUZP3M+iyA3pw='
WHERE
key_id = '02ec9e834574f44e958bb33ac17648bb92059e232c291dfb1179de3d5c8b1bb0'
AND (
token = '+shuuL8yAGwnVssoRRFT6JsNGvC7VXjUZP3M+iyA3pw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)