UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+9NNLxJaHC4AmkETlP0wy4c6HDp9Tqy/4xu2KZE9BV4=' 
WHERE 
  key_id = '7f2ec7efbff2d66f62d22a334c7b9c4ec72fb8abc499b5cfc068837d7b07240a' 
  AND (
    token = '+9NNLxJaHC4AmkETlP0wy4c6HDp9Tqy/4xu2KZE9BV4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017