UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1FR2R8MHkE5wP0J0lTnFvZidlpOzk4OuVVsjSaFUvL8=' 
WHERE 
  key_id = 'a03d4b062b8799aa928bca9315ec75196ce6ae0d890220e4297ed9c1c2cdb8d3' 
  AND (
    token = '1FR2R8MHkE5wP0J0lTnFvZidlpOzk4OuVVsjSaFUvL8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031