UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9JxzgUrWlVw3nybOWtInOa80w4TC3HAI861zL6tH2Cg=' 
WHERE 
  key_id = '769c683ba96bdfe7649e7a1a428adec751f093379d4a81a1932317f6451e34da' 
  AND (
    token = '9JxzgUrWlVw3nybOWtInOa80w4TC3HAI861zL6tH2Cg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049