UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eX0066IxtfYjr3UF/blnbTDtwOdFKRLxStnZBp5PdPw='
WHERE
key_id = 'c38021cdce20213272d4432cd7b9d5f9e7dcbba0f88deab0e607905a21d74b5d'
AND (
token = 'eX0066IxtfYjr3UF/blnbTDtwOdFKRLxStnZBp5PdPw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)