UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'J/qT5WHafdSfu/LGj7FSIDoOaQ7DTZ87rYLcGNNJVuU=' 
WHERE 
  key_id = 'e0bed0280d9fcf126423c7dd97e45e6eaf7c893a3a17b8af16ae90094c2db515' 
  AND (
    token = 'J/qT5WHafdSfu/LGj7FSIDoOaQ7DTZ87rYLcGNNJVuU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029