UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'v9eJHOlK7hPT/a8iCmknseK9UeAn8bCGcdn5KbEQhdY='
WHERE
key_id = '1f2fdce68dcb1dc48ee61d58db51aa12f21ea64b6a0c14b6540a83accff66809'
AND (
token = 'v9eJHOlK7hPT/a8iCmknseK9UeAn8bCGcdn5KbEQhdY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)