UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eNDm9L/6U7w7gt1VfeNEzNEY1L6H9JNMzp+Dgp+3raM=' 
WHERE 
  key_id = '809f9bedebf4358bd9b025039b92fe48894db60c60b522a3a910afe4ba33c2fc' 
  AND (
    token = 'eNDm9L/6U7w7gt1VfeNEzNEY1L6H9JNMzp+Dgp+3raM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031