UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nTF7Xk+FD0cwTBuIuzDe6yMZJjkaopOGsFXMl1HkW8A='
WHERE
key_id = '56f88d4f713ea70765866a3a459d91cfacc73f4fc8cde7a5c40dc365d8d0e0fc'
AND (
token = 'nTF7Xk+FD0cwTBuIuzDe6yMZJjkaopOGsFXMl1HkW8A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)