UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nFHFOeJhNgzW3u59TioarWnO2FmqpVAnNbM6CuE4Wto=' 
WHERE 
  key_id = 'cb7dfeb710c85063edddd9b282f040368e4c45af8dc500076a7f5d607e5dd942' 
  AND (
    token = 'nFHFOeJhNgzW3u59TioarWnO2FmqpVAnNbM6CuE4Wto=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033