UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kFmtXFTdAk+EvMId8jpygmTgaWMf3kEtGU9mFNanZFs='
WHERE
key_id = '3febd4b61fbb953dbf42974230c1b3a7aaef5a56ecabc05b8f5696ea48a3989a'
AND (
token = 'kFmtXFTdAk+EvMId8jpygmTgaWMf3kEtGU9mFNanZFs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)