UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RQ0NQEFzhu8I7HZ/VNtVeCj3+TfaHhSZNzhPJoIgmiw=' 
WHERE 
  key_id = 'f406e942f448a3bb0941b53ba95f16e2833736e77729124317d4c71a248590c7' 
  AND (
    token = 'RQ0NQEFzhu8I7HZ/VNtVeCj3+TfaHhSZNzhPJoIgmiw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026