UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bjisTQXPw9nN6W1Kw+VMJwhpZ7fxcFTp+oY4gg7jTvo='
WHERE
key_id = '3dea27c786c8948ea60697ae0ea6032697c7ebe9613e5989119686f91b8921d8'
AND (
token = 'bjisTQXPw9nN6W1Kw+VMJwhpZ7fxcFTp+oY4gg7jTvo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)